<?php

namespace App\Admin\Controllers;

use App\Admin\Grid\NGrid;
use App\Admin\Service\WithdrawService;
use Encore\Admin\Controllers\AdminController;
use Encore\Admin\Layout\Content;

class WithdrawController extends AdminController
{
    protected $title = '提现';

    private WithdrawService $service;

    /**
     * @param WithdrawService $service
     */
    public function __construct(WithdrawService $service)
    {
        $this->service = $service;
    }

    protected function grid(): NGrid
    {
        $this->service->grid();
        return $this->service->grid;
    }

    /**
     * detail
     * @param int $id
     * @param Content $content
     * @return Content
     */
    protected function detail(int $id, Content $content): Content
    {
        $this->service->show($id);
        return $content->title($this->title())
            ->description($this->description['show'] ?? trans('admin.show'))
            ->body($this->service->show);
    }
}
